<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet" type="text/css" href="css/test.css">
<title>Welcome ImageTest</title>
<%@ page import="com.test.getfile.*" %>

<script language="javascript">
var imgIndex = 0;
function getNextImagePath()
{
	var imgtotal = document.getElementById("imgtotalnum").value;
	if(imgIndex >= imgtotal-1)
	{
		imgIndex = 0;
		
	}else
	{
		imgIndex++;
	}
	document.getElementById("imagePath").src="image_svr?imgnum=" + imgIndex;
}

function exitCurrentUser()
{
	
}
</script>
</head>
<body>

<%! int nTotalFileNum = 0; %>
<%
	TestFile tf = new TestFile();
	tf.GetFilePath("D:/1");
	nTotalFileNum = tf.filePathList.size();
	//System.out.println(nTotalFileNum);
%>

<%! String currentUser = null; %>
<%
//判断是否已经有用户登录
	currentUser = (String)session.getAttribute("currentUser");
	if(null != currentUser)
	{
		out.print("<p id='welcomeInfo'> 当前登录用户："+currentUser+" <a href='/ImageTest/test.jsp'>退出当前用户</a></p>");
	}
	
%>


<div id="header"></div>

<ul id="nav">
<li><a href="/ImageTest/index.jsp">首页</a></li>
<li><a href="/ImageTest/viewImage.jsp">看图片</a></li>
<li><a href="/ImageTest/upload_file.jsp">上传图片</a></li>
<li><a href="/ImageTest/login.jsp">登录</a></li>
<li><a href="/ImageTest/regist.jsp">注册用户</a></li>
<li><a href="/ImageTest/administor.jsp">管理员</a></li>
</ul>

<div id="img">
	<img id="imagePath" src="image_svr" onclick="getNextImagePath()"/>
	<input type="hidden" id="imgtotalnum" value="<%= nTotalFileNum%>">  
</div>
</body>
</html>
